package com.moxiao.yfjh.module.blind.dal.mysql.constellationtest;

import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import com.moxiao.yfjh.module.blind.dal.dataobject.constellationtest.ConstellationTestDO;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.blind.controller.admin.constellationtest.vo.*;

/**
 * 相亲会员星座测试 Mapper
 *
 * @author mx
 */
@Mapper
public interface ConstellationTestMapper extends BaseMapperX<ConstellationTestDO> {

    default PageResult<ConstellationTestDO> selectPage(ConstellationTestPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ConstellationTestDO>()
                .eqIfPresent(ConstellationTestDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ConstellationTestDO::getBirthday, reqVO.getBirthday())
                .eqIfPresent(ConstellationTestDO::getLunarBirthday, reqVO.getLunarBirthday())
                .betweenIfPresent(ConstellationTestDO::getBirthTime, reqVO.getBirthTime())
                .eqIfPresent(ConstellationTestDO::getAreaId, reqVO.getAreaId())
                .eqIfPresent(ConstellationTestDO::getNativePlace, reqVO.getNativePlace())
                .eqIfPresent(ConstellationTestDO::getStatus,reqVO.getStatus())
                .betweenIfPresent(ConstellationTestDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ConstellationTestDO::getId));
    }

    default List<ConstellationTestDO> selectList(ConstellationTestExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ConstellationTestDO>()
                .eqIfPresent(ConstellationTestDO::getUserId, reqVO.getUserId())
                .eqIfPresent(ConstellationTestDO::getBirthday, reqVO.getBirthday())
                .eqIfPresent(ConstellationTestDO::getLunarBirthday, reqVO.getLunarBirthday())
                .betweenIfPresent(ConstellationTestDO::getBirthTime, reqVO.getBirthTime())
                .eqIfPresent(ConstellationTestDO::getAreaId, reqVO.getAreaId())
                .eqIfPresent(ConstellationTestDO::getNativePlace, reqVO.getNativePlace())
                .betweenIfPresent(ConstellationTestDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ConstellationTestDO::getStatus,reqVO.getStatus())
                .orderByDesc(ConstellationTestDO::getId));
    }

}
